<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8"/>
    <title></title>
    <style>

    </style>
</head>
<body>
<h2 style="display: none;">20160225基础回顾</h2>
<script>
    document.write.prototype = function () {
        alert(1);
    }
    var tarr = new Array('啊', '不', '才', '的');

    document.write(tarr.join(','));
    document.write('<br>');
    document.write(tarr.slice(0, 2));
    document.write('<br>');
    document.write(tarr.slice(-3, 3));


    function baseClass() {
        this.name='name1',
        this.showMsg = function () {
            alert(this.name);
            return 'baseclass';
        }
    }

    function extendClass() {
        this.name='name2'
    }


    var aa=new baseClass();
    aa.showMsg();
    extendClass.prototype = new baseClass();
    var instance = new extendClass();
    instance.showMsg(); // 显示baseClass::showMsg


</script>
</body>
</html> 